package it.uniroma2;

import java.io.File;
import java.util.Random;

import utility.PhotoClassesCreator;

public class Workload {

	private File workloadDir;

	private Random r = new Random(1001); // fix this

	public Workload(String workloadDir) {
			this.workloadDir = new File(workloadDir);	
	}
	
	public File pick(int index){
		return workloadDir.listFiles()[index];
	}
	
	public File randomPick(){
		int index = r.nextInt(workloadDir.listFiles().length);
		return pick(index);
	}
		
	/**
	 * @param args
	 */
	public String toString (){
		return "{ [workloadDir: "+ workloadDir +"]}";
	}
	public static void main(String[] args) {
		Workload workload = new Workload(PhotoClassesCreator.size_101_200.getAbsolutePath());
		
		for(int i = 0; i< 20; i++){
			System.out.println(workload.randomPick().getName());			
		}
		

	}

}
